﻿<Page x:Name="page"
    x:Class="App33.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:App33"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.DataContext>
        <local:MainPageViewModel/>
    </Page.DataContext>

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

        <!-- pivot -->
        <Hub Loaded="Hub_Loaded" Margin="0,100,0,0">
            <HubSection Header="Section One" Background="Maroon" Width="{Binding NinetyPercent}" Tapped="HubSection_Tapped" />
            <HubSection Header="Section Two" Background="Green" Width="{Binding NinetyPercent}" Tapped="HubSection_Tapped"/>
            <HubSection Header="Section Three" Background="Navy" Width="{Binding NinetyPercent}" Tapped="HubSection_Tapped"/>
            <HubSection Header="Section Four" Background="Orange" Width="{Binding NinetyPercent}" Tapped="HubSection_Tapped"/>
            <HubSection Width="{Binding NinetyPercent}" Tapped="HubSection_Tapped">
                <HubSection.Template>
                    <ControlTemplate>
                        <Image Source="{Binding Bitmap}" Stretch="None" />
                    </ControlTemplate>
                </HubSection.Template>
            </HubSection>
        </Hub>

        <!-- header -->
        <ItemsControl VerticalAlignment="Top" HorizontalAlignment="Left" ItemsSource="{Binding Headers}" Margin="20">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal" />
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Button Content="{Binding Header}" FontSize="{StaticResource HubHeaderThemeFontSize}" Click="Button_Click"
                            Margin="0,0,60,0" Style="{StaticResource TextBlockButtonStyle}" Opacity="{Binding Opacity}" FontWeight="Light" />
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>

    </Grid>

</Page>
